package com.coffee.log.dispose;

import com.coffee.log.capture.OperationLogBO;

import java.time.LocalDateTime;

/**
 * @author songkui
 * @since 2025/03/24
 */

public class OperationLongConvert {

    public static OperationEntity entityToVO(OperationLogBO operationLogBO) {
        OperationEntity entity = new OperationEntity();
        entity.setName(operationLogBO.getName())
                .setDescription(operationLogBO.getDescription())
                .setParams(operationLogBO.getParams())
                .setStatus(operationLogBO.getStatus())
                .setErrorMsg(operationLogBO.getErrorMsg())
                .setCostTime(operationLogBO.getCostTime())
                .setUserId(operationLogBO.getUserId())
                .setUserCode(operationLogBO.getUserCode())
                .setCreateTime(LocalDateTime.now());
        return entity;
    }

}
